﻿using Ultraviolet.FreeType2.Native;
using Ultraviolet.Graphics.Graphics2D.Text;

namespace Ultraviolet.FreeType2
{
#pragma warning disable 1591
    internal static class TextScriptUtil
    {
        /// <summary>
        /// Converts a <see cref="TextScript"/> value to an <see cref="hb_script_t"/> value.
        /// </summary>
        /// <param name="script">The script to convert.</param>
        /// <returns>The converted script.</returns>
        public static hb_script_t UltravioletToHarfBuzz(TextScript script)
        {
            switch (script)
            {
                case TextScript.Invalid:
                    return hb_script_t.HB_SCRIPT_INVALID;
                case TextScript.Common:
                    return hb_script_t.HB_SCRIPT_COMMON;
                case TextScript.Inherited:
                    return hb_script_t.HB_SCRIPT_INHERITED;
                case TextScript.Unknown:
                    return hb_script_t.HB_SCRIPT_UNKNOWN;
                case TextScript.Arabic:
                    return hb_script_t.HB_SCRIPT_ARABIC;
                case TextScript.Armenian:
                    return hb_script_t.HB_SCRIPT_ARMENIAN;
                case TextScript.Bengali:
                    return hb_script_t.HB_SCRIPT_BENGALI;
                case TextScript.Cyrillic:
                    return hb_script_t.HB_SCRIPT_CYRILLIC;
                case TextScript.Devanagari:
                    return hb_script_t.HB_SCRIPT_DEVANAGARI;
                case TextScript.Georgian:
                    return hb_script_t.HB_SCRIPT_GEORGIAN;
                case TextScript.Greek:
                    return hb_script_t.HB_SCRIPT_GREEK;
                case TextScript.Gujarati:
                    return hb_script_t.HB_SCRIPT_GUJARATI;
                case TextScript.Gurmukhi:
                    return hb_script_t.HB_SCRIPT_GURMUKHI;
                case TextScript.Hangul:
                    return hb_script_t.HB_SCRIPT_HANGUL;
                case TextScript.Han:
                    return hb_script_t.HB_SCRIPT_HAN;
                case TextScript.Hebrew:
                    return hb_script_t.HB_SCRIPT_HEBREW;
                case TextScript.Hiragana:
                    return hb_script_t.HB_SCRIPT_HIRAGANA;
                case TextScript.Kannada:
                    return hb_script_t.HB_SCRIPT_KANNADA;
                case TextScript.Katakana:
                    return hb_script_t.HB_SCRIPT_KATAKANA;
                case TextScript.Lao:
                    return hb_script_t.HB_SCRIPT_LAO;
                case TextScript.Latin:
                    return hb_script_t.HB_SCRIPT_LATIN;
                case TextScript.Malayalam:
                    return hb_script_t.HB_SCRIPT_MALAYALAM;
                case TextScript.Oriya:
                    return hb_script_t.HB_SCRIPT_ORIYA;
                case TextScript.Tamil:
                    return hb_script_t.HB_SCRIPT_TAMIL;
                case TextScript.Telugu:
                    return hb_script_t.HB_SCRIPT_TELUGU;
                case TextScript.Thai:
                    return hb_script_t.HB_SCRIPT_THAI;
                case TextScript.Tibetan:
                    return hb_script_t.HB_SCRIPT_TIBETAN;
                case TextScript.Bopomofo:
                    return hb_script_t.HB_SCRIPT_BOPOMOFO;
                case TextScript.Braille:
                    return hb_script_t.HB_SCRIPT_BRAILLE;
                case TextScript.CanadianSyllabics:
                    return hb_script_t.HB_SCRIPT_CANADIAN_SYLLABICS;
                case TextScript.Cherokee:
                    return hb_script_t.HB_SCRIPT_CHEROKEE;
                case TextScript.Ethiopic:
                    return hb_script_t.HB_SCRIPT_ETHIOPIC;
                case TextScript.Khmer:
                    return hb_script_t.HB_SCRIPT_KHMER;
                case TextScript.Mongolian:
                    return hb_script_t.HB_SCRIPT_MONGOLIAN;
                case TextScript.Myanmar:
                    return hb_script_t.HB_SCRIPT_MYANMAR;
                case TextScript.Ogham:
                    return hb_script_t.HB_SCRIPT_OGHAM;
                case TextScript.Runic:
                    return hb_script_t.HB_SCRIPT_RUNIC;
                case TextScript.Sinhala:
                    return hb_script_t.HB_SCRIPT_SINHALA;
                case TextScript.Syriac:
                    return hb_script_t.HB_SCRIPT_SYRIAC;
                case TextScript.Thaana:
                    return hb_script_t.HB_SCRIPT_THAANA;
                case TextScript.Yi:
                    return hb_script_t.HB_SCRIPT_YI;
                case TextScript.Deseret:
                    return hb_script_t.HB_SCRIPT_DESERET;
                case TextScript.Gothic:
                    return hb_script_t.HB_SCRIPT_GOTHIC;
                case TextScript.OldItalic:
                    return hb_script_t.HB_SCRIPT_OLD_ITALIC;
                case TextScript.Buhid:
                    return hb_script_t.HB_SCRIPT_BUHID;
                case TextScript.Hanunoo:
                    return hb_script_t.HB_SCRIPT_HANUNOO;
                case TextScript.Tagalog:
                    return hb_script_t.HB_SCRIPT_TAGALOG;
                case TextScript.Tagbanwa:
                    return hb_script_t.HB_SCRIPT_TAGBANWA;
                case TextScript.Cypriot:
                    return hb_script_t.HB_SCRIPT_CYPRIOT;
                case TextScript.Limbu:
                    return hb_script_t.HB_SCRIPT_LIMBU;
                case TextScript.LinearB:
                    return hb_script_t.HB_SCRIPT_LINEAR_B;
                case TextScript.Osmanya:
                    return hb_script_t.HB_SCRIPT_OSMANYA;
                case TextScript.Shavian:
                    return hb_script_t.HB_SCRIPT_SHAVIAN;
                case TextScript.TaiLe:
                    return hb_script_t.HB_SCRIPT_TAI_LE;
                case TextScript.Ugaritic:
                    return hb_script_t.HB_SCRIPT_UGARITIC;
                case TextScript.Buginese:
                    return hb_script_t.HB_SCRIPT_BUGINESE;
                case TextScript.Coptic:
                    return hb_script_t.HB_SCRIPT_COPTIC;
                case TextScript.Glagolitic:
                    return hb_script_t.HB_SCRIPT_GLAGOLITIC;
                case TextScript.Kharoshthi:
                    return hb_script_t.HB_SCRIPT_KHAROSHTHI;
                case TextScript.NewTaiLue:
                    return hb_script_t.HB_SCRIPT_NEW_TAI_LUE;
                case TextScript.OldPersian:
                    return hb_script_t.HB_SCRIPT_OLD_PERMIC;
                case TextScript.SylotiNagri:
                    return hb_script_t.HB_SCRIPT_SYLOTI_NAGRI;
                case TextScript.Tifinagh:
                    return hb_script_t.HB_SCRIPT_TIFINAGH;
                case TextScript.Balinese:
                    return hb_script_t.HB_SCRIPT_BALINESE;
                case TextScript.Cuneiform:
                    return hb_script_t.HB_SCRIPT_CUNEIFORM;
                case TextScript.Nko:
                    return hb_script_t.HB_SCRIPT_NKO;
                case TextScript.PhagsPa:
                    return hb_script_t.HB_SCRIPT_PHAGS_PA;
                case TextScript.Phoenician:
                    return hb_script_t.HB_SCRIPT_PHOENICIAN;
                case TextScript.Carian:
                    return hb_script_t.HB_SCRIPT_CARIAN;
                case TextScript.Cham:
                    return hb_script_t.HB_SCRIPT_CHAM;
                case TextScript.KayahLi:
                    return hb_script_t.HB_SCRIPT_KAYAH_LI;
                case TextScript.Lepcha:
                    return hb_script_t.HB_SCRIPT_LEPCHA;
                case TextScript.Lycian:
                    return hb_script_t.HB_SCRIPT_LYCIAN;
                case TextScript.Lydian:
                    return hb_script_t.HB_SCRIPT_LYDIAN;
                case TextScript.OlChiki:
                    return hb_script_t.HB_SCRIPT_OL_CHIKI;
                case TextScript.Rejang:
                    return hb_script_t.HB_SCRIPT_REJANG;
                case TextScript.Saurashtra:
                    return hb_script_t.HB_SCRIPT_SAURASHTRA;
                case TextScript.Sundanese:
                    return hb_script_t.HB_SCRIPT_SUNDANESE;
                case TextScript.Vai:
                    return hb_script_t.HB_SCRIPT_VAI;
                case TextScript.Avestan:
                    return hb_script_t.HB_SCRIPT_AVESTAN;
                case TextScript.Bamum:
                    return hb_script_t.HB_SCRIPT_BAMUM;
                case TextScript.EgyptianHieroglyphs:
                    return hb_script_t.HB_SCRIPT_EGYPTIAN_HIEROGLYPHS;
                case TextScript.ImperialAramaic:
                    return hb_script_t.HB_SCRIPT_IMPERIAL_ARAMAIC;
                case TextScript.InscriptionalPahlavi:
                    return hb_script_t.HB_SCRIPT_INSCRIPTIONAL_PAHLAVI;
                case TextScript.InscriptionalParthian:
                    return hb_script_t.HB_SCRIPT_INSCRIPTIONAL_PARTHIAN;
                case TextScript.Javanese:
                    return hb_script_t.HB_SCRIPT_JAVANESE;
                case TextScript.Kaithi:
                    return hb_script_t.HB_SCRIPT_KAITHI;
                case TextScript.Lisu:
                    return hb_script_t.HB_SCRIPT_LISU;
                case TextScript.MeeteiMayek:
                    return hb_script_t.HB_SCRIPT_MEETEI_MAYEK;
                case TextScript.OldSouthArabian:
                    return hb_script_t.HB_SCRIPT_OLD_SOUTH_ARABIAN;
                case TextScript.OldTurkic:
                    return hb_script_t.HB_SCRIPT_OLD_TURKIC;
                case TextScript.Samaritan:
                    return hb_script_t.HB_SCRIPT_SAMARITAN;
                case TextScript.TaiTham:
                    return hb_script_t.HB_SCRIPT_TAI_THAM;
                case TextScript.TaiViet:
                    return hb_script_t.HB_SCRIPT_TAI_VIET;
                case TextScript.Batak:
                    return hb_script_t.HB_SCRIPT_BATAK;
                case TextScript.Brahmi:
                    return hb_script_t.HB_SCRIPT_BRAHMI;
                case TextScript.Mandaic:
                    return hb_script_t.HB_SCRIPT_MANDAIC;
                case TextScript.Chakma:
                    return hb_script_t.HB_SCRIPT_CHAKMA;
                case TextScript.MeroiticCursive:
                    return hb_script_t.HB_SCRIPT_MEROITIC_CURSIVE;
                case TextScript.MeroiticHieroglyphs:
                    return hb_script_t.HB_SCRIPT_MEROITIC_HIEROGLYPHS;
                case TextScript.Miao:
                    return hb_script_t.HB_SCRIPT_MIAO;
                case TextScript.Sharada:
                    return hb_script_t.HB_SCRIPT_SHARADA;
                case TextScript.SoraSompeng:
                    return hb_script_t.HB_SCRIPT_SORA_SOMPENG;
                case TextScript.Takri:
                    return hb_script_t.HB_SCRIPT_TAKRI;
                case TextScript.BassaVah:
                    return hb_script_t.HB_SCRIPT_BASSA_VAH;
                case TextScript.CaucasianAlbanian:
                    return hb_script_t.HB_SCRIPT_CAUCASIAN_ALBANIAN;
                case TextScript.Duployan:
                    return hb_script_t.HB_SCRIPT_DUPLOYAN;
                case TextScript.Elbasan:
                    return hb_script_t.HB_SCRIPT_ELBASAN;
                case TextScript.Grantha:
                    return hb_script_t.HB_SCRIPT_GRANTHA;
                case TextScript.Khojki:
                    return hb_script_t.HB_SCRIPT_KHOJKI;
                case TextScript.Khudawadi:
                    return hb_script_t.HB_SCRIPT_KHUDAWADI;
                case TextScript.LinearA:
                    return hb_script_t.HB_SCRIPT_LINEAR_A;
                case TextScript.Mahajani:
                    return hb_script_t.HB_SCRIPT_MAHAJANI;
                case TextScript.Manichaean:
                    return hb_script_t.HB_SCRIPT_MANICHAEAN;
                case TextScript.MendeKikakui:
                    return hb_script_t.HB_SCRIPT_MENDE_KIKAKUI;
                case TextScript.Modi:
                    return hb_script_t.HB_SCRIPT_MODI;
                case TextScript.Mro:
                    return hb_script_t.HB_SCRIPT_MRO;
                case TextScript.Nabataean:
                    return hb_script_t.HB_SCRIPT_NABATAEAN;
                case TextScript.OldNorthArabian:
                    return hb_script_t.HB_SCRIPT_OLD_NORTH_ARABIAN;
                case TextScript.OldPermic:
                    return hb_script_t.HB_SCRIPT_OLD_PERMIC;
                case TextScript.PahawhHmong:
                    return hb_script_t.HB_SCRIPT_PAHAWH_HMONG;
                case TextScript.Palmyrene:
                    return hb_script_t.HB_SCRIPT_PALMYRENE;
                case TextScript.PauCinHau:
                    return hb_script_t.HB_SCRIPT_PAU_CIN_HAU;
                case TextScript.PsalterPahlavi:
                    return hb_script_t.HB_SCRIPT_PSALTER_PAHLAVI;
                case TextScript.Siddham:
                    return hb_script_t.HB_SCRIPT_SIDDHAM;
                case TextScript.Tirhuta:
                    return hb_script_t.HB_SCRIPT_TIRHUTA;
                case TextScript.WarangCiti:
                    return hb_script_t.HB_SCRIPT_WARANG_CITI;
                case TextScript.Ahom:
                    return hb_script_t.HB_SCRIPT_AHOM;
                case TextScript.AnatolianHieroglyphs:
                    return hb_script_t.HB_SCRIPT_ANATOLIAN_HIEROGLYPHS;
                case TextScript.Hatran:
                    return hb_script_t.HB_SCRIPT_HATRAN;
                case TextScript.Multani:
                    return hb_script_t.HB_SCRIPT_MULTANI;
                case TextScript.OldHungarian:
                    return hb_script_t.HB_SCRIPT_OLD_HUNGARIAN;
                case TextScript.SignWriting:
                    return hb_script_t.HB_SCRIPT_SIGNWRITING;
                case TextScript.Adlam:
                    return hb_script_t.HB_SCRIPT_ADLAM;
                case TextScript.Bhaiksuki:
                    return hb_script_t.HB_SCRIPT_BHAIKSUKI;
                case TextScript.Marchen:
                    return hb_script_t.HB_SCRIPT_MARCHEN;
                case TextScript.Osage:
                    return hb_script_t.HB_SCRIPT_OSAGE;
                case TextScript.Tangut:
                    return hb_script_t.HB_SCRIPT_TANGUT;
                case TextScript.Newa:
                    return hb_script_t.HB_SCRIPT_NEWA;
                case TextScript.MasaramGondi:
                    return hb_script_t.HB_SCRIPT_MASARAM_GONDI;
                case TextScript.Nushu:
                    return hb_script_t.HB_SCRIPT_NUSHU;
                case TextScript.Soyombo:
                    return hb_script_t.HB_SCRIPT_SOYOMBO;
                case TextScript.ZanabazarSquare:
                    return hb_script_t.HB_SCRIPT_ZANABAZAR_SQUARE;
                default:
                    return hb_script_t.HB_SCRIPT_INVALID;
            }
        }

        /// <summary>
        /// Converts an <see cref="hb_script_t"/> value to a <see cref="TextScript"/> value.
        /// </summary>
        /// <param name="script">The script to convert.</param>
        /// <returns>The script direction.</returns>
        public static TextScript HarfBuzzToUltraviolet(hb_script_t script)
        {
            switch (script)
            {
                case hb_script_t.HB_SCRIPT_COMMON:
                    return TextScript.Common;
                case hb_script_t.HB_SCRIPT_INHERITED:
                    return TextScript.Inherited;
                case hb_script_t.HB_SCRIPT_UNKNOWN:
                    return TextScript.Unknown;
                case hb_script_t.HB_SCRIPT_ARABIC:
                    return TextScript.Arabic;
                case hb_script_t.HB_SCRIPT_ARMENIAN:
                    return TextScript.Armenian;
                case hb_script_t.HB_SCRIPT_BENGALI:
                    return TextScript.Bengali;
                case hb_script_t.HB_SCRIPT_CYRILLIC:
                    return TextScript.Cyrillic;
                case hb_script_t.HB_SCRIPT_DEVANAGARI:
                    return TextScript.Devanagari;
                case hb_script_t.HB_SCRIPT_GEORGIAN:
                    return TextScript.Georgian;
                case hb_script_t.HB_SCRIPT_GREEK:
                    return TextScript.Greek;
                case hb_script_t.HB_SCRIPT_GUJARATI:
                    return TextScript.Gujarati;
                case hb_script_t.HB_SCRIPT_GURMUKHI:
                    return TextScript.Gurmukhi;
                case hb_script_t.HB_SCRIPT_HANGUL:
                    return TextScript.Hangul;
                case hb_script_t.HB_SCRIPT_HAN:
                    return TextScript.Han;
                case hb_script_t.HB_SCRIPT_HEBREW:
                    return TextScript.Hebrew;
                case hb_script_t.HB_SCRIPT_HIRAGANA:
                    return TextScript.Hiragana;
                case hb_script_t.HB_SCRIPT_KANNADA:
                    return TextScript.Kannada;
                case hb_script_t.HB_SCRIPT_KATAKANA:
                    return TextScript.Katakana;
                case hb_script_t.HB_SCRIPT_LAO:
                    return TextScript.Lao;
                case hb_script_t.HB_SCRIPT_LATIN:
                    return TextScript.Latin;
                case hb_script_t.HB_SCRIPT_MALAYALAM:
                    return TextScript.Malayalam;
                case hb_script_t.HB_SCRIPT_ORIYA:
                    return TextScript.Oriya;
                case hb_script_t.HB_SCRIPT_TAMIL:
                    return TextScript.Tamil;
                case hb_script_t.HB_SCRIPT_TELUGU:
                    return TextScript.Telugu;
                case hb_script_t.HB_SCRIPT_THAI:
                    return TextScript.Thai;
                case hb_script_t.HB_SCRIPT_TIBETAN:
                    return TextScript.Tibetan;
                case hb_script_t.HB_SCRIPT_BOPOMOFO:
                    return TextScript.Bopomofo;
                case hb_script_t.HB_SCRIPT_BRAILLE:
                    return TextScript.Braille;
                case hb_script_t.HB_SCRIPT_CANADIAN_SYLLABICS:
                    return TextScript.CanadianSyllabics;
                case hb_script_t.HB_SCRIPT_CHEROKEE:
                    return TextScript.Cherokee;
                case hb_script_t.HB_SCRIPT_ETHIOPIC:
                    return TextScript.Ethiopic;
                case hb_script_t.HB_SCRIPT_KHMER:
                    return TextScript.Khmer;
                case hb_script_t.HB_SCRIPT_MONGOLIAN:
                    return TextScript.Mongolian;
                case hb_script_t.HB_SCRIPT_MYANMAR:
                    return TextScript.Myanmar;
                case hb_script_t.HB_SCRIPT_OGHAM:
                    return TextScript.Ogham;
                case hb_script_t.HB_SCRIPT_RUNIC:
                    return TextScript.Runic;
                case hb_script_t.HB_SCRIPT_SINHALA:
                    return TextScript.Sinhala;
                case hb_script_t.HB_SCRIPT_SYRIAC:
                    return TextScript.Syriac;
                case hb_script_t.HB_SCRIPT_THAANA:
                    return TextScript.Thaana;
                case hb_script_t.HB_SCRIPT_YI:
                    return TextScript.Yi;
                case hb_script_t.HB_SCRIPT_DESERET:
                    return TextScript.Deseret;
                case hb_script_t.HB_SCRIPT_GOTHIC:
                    return TextScript.Gothic;
                case hb_script_t.HB_SCRIPT_OLD_ITALIC:
                    return TextScript.OldItalic;
                case hb_script_t.HB_SCRIPT_BUHID:
                    return TextScript.Buhid;
                case hb_script_t.HB_SCRIPT_HANUNOO:
                    return TextScript.Hanunoo;
                case hb_script_t.HB_SCRIPT_TAGALOG:
                    return TextScript.Tagalog;
                case hb_script_t.HB_SCRIPT_TAGBANWA:
                    return TextScript.Tagbanwa;
                case hb_script_t.HB_SCRIPT_CYPRIOT:
                    return TextScript.Cypriot;
                case hb_script_t.HB_SCRIPT_LIMBU:
                    return TextScript.Limbu;
                case hb_script_t.HB_SCRIPT_LINEAR_B:
                    return TextScript.LinearB;
                case hb_script_t.HB_SCRIPT_OSMANYA:
                    return TextScript.Osmanya;
                case hb_script_t.HB_SCRIPT_SHAVIAN:
                    return TextScript.Shavian;
                case hb_script_t.HB_SCRIPT_TAI_LE:
                    return TextScript.TaiLe;
                case hb_script_t.HB_SCRIPT_UGARITIC:
                    return TextScript.Ugaritic;
                case hb_script_t.HB_SCRIPT_BUGINESE:
                    return TextScript.Buginese;
                case hb_script_t.HB_SCRIPT_COPTIC:
                    return TextScript.Coptic;
                case hb_script_t.HB_SCRIPT_GLAGOLITIC:
                    return TextScript.Glagolitic;
                case hb_script_t.HB_SCRIPT_KHAROSHTHI:
                    return TextScript.Kharoshthi;
                case hb_script_t.HB_SCRIPT_NEW_TAI_LUE:
                    return TextScript.NewTaiLue;
                case hb_script_t.HB_SCRIPT_OLD_PERSIAN:
                    return TextScript.OldPersian;
                case hb_script_t.HB_SCRIPT_SYLOTI_NAGRI:
                    return TextScript.SylotiNagri;
                case hb_script_t.HB_SCRIPT_TIFINAGH:
                    return TextScript.Tifinagh;
                case hb_script_t.HB_SCRIPT_BALINESE:
                    return TextScript.Balinese;
                case hb_script_t.HB_SCRIPT_CUNEIFORM:
                    return TextScript.Cuneiform;
                case hb_script_t.HB_SCRIPT_NKO:
                    return TextScript.Nko;
                case hb_script_t.HB_SCRIPT_PHAGS_PA:
                    return TextScript.PhagsPa;
                case hb_script_t.HB_SCRIPT_PHOENICIAN:
                    return TextScript.Phoenician;
                case hb_script_t.HB_SCRIPT_CARIAN:
                    return TextScript.Carian;
                case hb_script_t.HB_SCRIPT_CHAM:
                    return TextScript.Cham;
                case hb_script_t.HB_SCRIPT_KAYAH_LI:
                    return TextScript.KayahLi;
                case hb_script_t.HB_SCRIPT_LEPCHA:
                    return TextScript.Lepcha;
                case hb_script_t.HB_SCRIPT_LYCIAN:
                    return TextScript.Lycian;
                case hb_script_t.HB_SCRIPT_LYDIAN:
                    return TextScript.Lydian;
                case hb_script_t.HB_SCRIPT_OL_CHIKI:
                    return TextScript.OlChiki;
                case hb_script_t.HB_SCRIPT_REJANG:
                    return TextScript.Rejang;
                case hb_script_t.HB_SCRIPT_SAURASHTRA:
                    return TextScript.Saurashtra;
                case hb_script_t.HB_SCRIPT_SUNDANESE:
                    return TextScript.Sundanese;
                case hb_script_t.HB_SCRIPT_VAI:
                    return TextScript.Vai;
                case hb_script_t.HB_SCRIPT_AVESTAN:
                    return TextScript.Avestan;
                case hb_script_t.HB_SCRIPT_BAMUM:
                    return TextScript.Bamum;
                case hb_script_t.HB_SCRIPT_EGYPTIAN_HIEROGLYPHS:
                    return TextScript.EgyptianHieroglyphs;
                case hb_script_t.HB_SCRIPT_IMPERIAL_ARAMAIC:
                    return TextScript.ImperialAramaic;
                case hb_script_t.HB_SCRIPT_INSCRIPTIONAL_PAHLAVI:
                    return TextScript.InscriptionalPahlavi;
                case hb_script_t.HB_SCRIPT_INSCRIPTIONAL_PARTHIAN:
                    return TextScript.InscriptionalParthian;
                case hb_script_t.HB_SCRIPT_JAVANESE:
                    return TextScript.Javanese;
                case hb_script_t.HB_SCRIPT_KAITHI:
                    return TextScript.Kaithi;
                case hb_script_t.HB_SCRIPT_LISU:
                    return TextScript.Lisu;
                case hb_script_t.HB_SCRIPT_MEETEI_MAYEK:
                    return TextScript.MeeteiMayek;
                case hb_script_t.HB_SCRIPT_OLD_SOUTH_ARABIAN:
                    return TextScript.OldSouthArabian;
                case hb_script_t.HB_SCRIPT_OLD_TURKIC:
                    return TextScript.OldTurkic;
                case hb_script_t.HB_SCRIPT_SAMARITAN:
                    return TextScript.Samaritan;
                case hb_script_t.HB_SCRIPT_TAI_THAM:
                    return TextScript.TaiTham;
                case hb_script_t.HB_SCRIPT_TAI_VIET:
                    return TextScript.TaiViet;
                case hb_script_t.HB_SCRIPT_BATAK:
                    return TextScript.Batak;
                case hb_script_t.HB_SCRIPT_BRAHMI:
                    return TextScript.Brahmi;
                case hb_script_t.HB_SCRIPT_MANDAIC:
                    return TextScript.Mandaic;
                case hb_script_t.HB_SCRIPT_CHAKMA:
                    return TextScript.Chakma;
                case hb_script_t.HB_SCRIPT_MEROITIC_CURSIVE:
                    return TextScript.MeroiticCursive;
                case hb_script_t.HB_SCRIPT_MEROITIC_HIEROGLYPHS:
                    return TextScript.MeroiticHieroglyphs;
                case hb_script_t.HB_SCRIPT_MIAO:
                    return TextScript.Miao;
                case hb_script_t.HB_SCRIPT_SHARADA:
                    return TextScript.Sharada;
                case hb_script_t.HB_SCRIPT_SORA_SOMPENG:
                    return TextScript.SoraSompeng;
                case hb_script_t.HB_SCRIPT_TAKRI:
                    return TextScript.Takri;
                case hb_script_t.HB_SCRIPT_BASSA_VAH:
                    return TextScript.BassaVah;
                case hb_script_t.HB_SCRIPT_CAUCASIAN_ALBANIAN:
                    return TextScript.CaucasianAlbanian;
                case hb_script_t.HB_SCRIPT_DUPLOYAN:
                    return TextScript.Duployan;
                case hb_script_t.HB_SCRIPT_ELBASAN:
                    return TextScript.Elbasan;
                case hb_script_t.HB_SCRIPT_GRANTHA:
                    return TextScript.Grantha;
                case hb_script_t.HB_SCRIPT_KHOJKI:
                    return TextScript.Khojki;
                case hb_script_t.HB_SCRIPT_KHUDAWADI:
                    return TextScript.Khudawadi;
                case hb_script_t.HB_SCRIPT_LINEAR_A:
                    return TextScript.LinearA;
                case hb_script_t.HB_SCRIPT_MAHAJANI:
                    return TextScript.Mahajani;
                case hb_script_t.HB_SCRIPT_MANICHAEAN:
                    return TextScript.Manichaean;
                case hb_script_t.HB_SCRIPT_MENDE_KIKAKUI:
                    return TextScript.MendeKikakui;
                case hb_script_t.HB_SCRIPT_MODI:
                    return TextScript.Modi;
                case hb_script_t.HB_SCRIPT_MRO:
                    return TextScript.Mro;
                case hb_script_t.HB_SCRIPT_NABATAEAN:
                    return TextScript.Nabataean;
                case hb_script_t.HB_SCRIPT_OLD_NORTH_ARABIAN:
                    return TextScript.OldNorthArabian;
                case hb_script_t.HB_SCRIPT_OLD_PERMIC:
                    return TextScript.OldPermic;
                case hb_script_t.HB_SCRIPT_PAHAWH_HMONG:
                    return TextScript.PahawhHmong;
                case hb_script_t.HB_SCRIPT_PALMYRENE:
                    return TextScript.Palmyrene;
                case hb_script_t.HB_SCRIPT_PAU_CIN_HAU:
                    return TextScript.PauCinHau;
                case hb_script_t.HB_SCRIPT_PSALTER_PAHLAVI:
                    return TextScript.PsalterPahlavi;
                case hb_script_t.HB_SCRIPT_SIDDHAM:
                    return TextScript.Siddham;
                case hb_script_t.HB_SCRIPT_TIRHUTA:
                    return TextScript.Tirhuta;
                case hb_script_t.HB_SCRIPT_WARANG_CITI:
                    return TextScript.WarangCiti;
                case hb_script_t.HB_SCRIPT_AHOM:
                    return TextScript.Ahom;
                case hb_script_t.HB_SCRIPT_ANATOLIAN_HIEROGLYPHS:
                    return TextScript.AnatolianHieroglyphs;
                case hb_script_t.HB_SCRIPT_HATRAN:
                    return TextScript.Hatran;
                case hb_script_t.HB_SCRIPT_MULTANI:
                    return TextScript.Multani;
                case hb_script_t.HB_SCRIPT_OLD_HUNGARIAN:
                    return TextScript.OldHungarian;
                case hb_script_t.HB_SCRIPT_SIGNWRITING:
                    return TextScript.SignWriting;
                case hb_script_t.HB_SCRIPT_ADLAM:
                    return TextScript.Adlam;
                case hb_script_t.HB_SCRIPT_BHAIKSUKI:
                    return TextScript.Bhaiksuki;
                case hb_script_t.HB_SCRIPT_MARCHEN:
                    return TextScript.Marchen;
                case hb_script_t.HB_SCRIPT_OSAGE:
                    return TextScript.Osage;
                case hb_script_t.HB_SCRIPT_TANGUT:
                    return TextScript.Tangut;
                case hb_script_t.HB_SCRIPT_NEWA:
                    return TextScript.Newa;
                case hb_script_t.HB_SCRIPT_MASARAM_GONDI:
                    return TextScript.MasaramGondi;
                case hb_script_t.HB_SCRIPT_NUSHU:
                    return TextScript.Nushu;
                case hb_script_t.HB_SCRIPT_SOYOMBO:
                    return TextScript.Soyombo;
                case hb_script_t.HB_SCRIPT_ZANABAZAR_SQUARE:
                    return TextScript.ZanabazarSquare;
                case hb_script_t.HB_SCRIPT_INVALID:
                    return TextScript.Invalid;
                default:
                    return TextScript.Invalid;
            }
        }
    }
#pragma warning restore 1591
}
